package edu.asu.cse360.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@NamedQueries({
    @NamedQuery(name=Table.FIND_ALL_BY_RESTAURANT, query="select t from Table t where t.restaurant=:restaurant")
})
@Entity
@javax.persistence.Table(name="tbl")
public class Table implements Serializable{
    public static final String FIND_ALL_BY_RESTAURANT = "Table.findAllByRestaurant";

    private static final long serialVersionUID = -1812052046984446113L;

    @Id
    @Column(name="tbl_id")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;

    @Column(name="table_number")
    private int tableNumber;

    @Column(name="max_capacity")
    private int maxCapacity;

    @Column(name="number_of_people")
    private int numberOfPeople;

    @Enumerated(EnumType.ORDINAL)
    private TableStatus status;

    @ManyToOne
    @JoinColumn(name="restaurant_id")
    private Restaurant restaurant;

    public void setTableNumber(int tableNumber) {
        this.tableNumber = tableNumber;
    }

    public int getTableNumber() {
        return tableNumber;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setMaxCapacity(int maxCapacity) {
        this.maxCapacity = maxCapacity;
    }

    public int getMaxCapacity() {
         return maxCapacity;
    }

    public void setNumberOfPeople(int numberOfPeople) {
        this.numberOfPeople = numberOfPeople;
    }

    public int getNumberOfPeople() {
        return numberOfPeople;
    }

    /**
     * @return the status
     */
    public TableStatus getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(TableStatus status) {
        this.status = status;
    }

    /**
     * @return the restaurant
     */
    public Restaurant getRestaurant() {
        return restaurant;
    }

    /**
     * @param restaurant the restaurant to set
     */
    public void setRestaurant(Restaurant restaurant) {
        this.restaurant = restaurant;
    }
	
}
